from mbsh.core.models import CasePaper
import unittest
import os
from mbsh import create_app


class ModelsTestCase(unittest.TestCase):
    def setUp(self):
        app = create_app(os.getenv('FLASK_CONFIG') or 'default')
        app.app_context().push()
        self.app = app

    def tearDown(self):
        print('tear down')
        # os.unlink(mbsh.app.config['DATABASE'])

    def test_get_file_name(self):
        paper = CasePaper.query.first()
        paper.update_patient_info({"PatientName": "hushan"})

        paper.update_patient_info({"PatientName": "hushan",
                                   "endoscopic_diagnosis": "食管：粘膜光滑，扩张好，血管清晰。&#xA;贲门：开闭好，齿状线清晰。&#xA;胃底：粘膜充血水肿，&#xA;胃体：粘膜光滑，皱壁走行自然,见胆汁斑。&#xA;胃角：弧形，粘膜光滑"})


if __name__ == '__main__':
    unittest.main()
